package com.zd.wechatPlatform.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zd.wechatPlatform.bean.model.WxKeywordMsg;
import com.zd.wechatPlatform.common.enums.StatusEnum;
import com.zd.wechatPlatform.dao.WxKeywordMsgDao;
import com.zd.wechatPlatform.dao.common.BaseDao;
import com.zd.wechatPlatform.dao.common.FindRequestEntity;
import com.zd.wechatPlatform.dao.common.OrderEnum;
import com.zd.wechatPlatform.dao.common.WhereEnum;
import com.zd.wechatPlatform.service.IWxKeywordMsgService;

@Service
public class WxKeywordMsgServiceImpl  extends BaseServiceImpl<WxKeywordMsg> implements IWxKeywordMsgService {
	@Autowired
	private WxKeywordMsgDao wxKeywordMsgDao;

	@Override
	public BaseDao<WxKeywordMsg> getBaseDao() {
		return wxKeywordMsgDao;
	}

	@Override
	public List<WxKeywordMsg> findKeywordMsg(Integer accountId) throws Exception {
		FindRequestEntity findReq = new FindRequestEntity();
		findReq.addWhere("account_id", WhereEnum.EQ, accountId);
		findReq.addWhere("status", WhereEnum.EQ, StatusEnum.valid.getKey());
		findReq.addOrder("seq", OrderEnum.ASC);
		List<WxKeywordMsg> keywordMsgList = find(findReq);
		return keywordMsgList;
	}
}
